package com.hibernate.chapter1;

import java.util.Date;

import javax.annotation.Generated;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

@Entity
@Table(name="StudentInfo")
public class Student {
	
	private int id;
	private String name;
	private String password;
	private String studentEmail;
	private boolean isRegular;
	private Date strtDate;
	
	@Temporal(TemporalType.DATE)
	public Date getStrtDate() {
		return strtDate;
	}

	public void setStrtDate(Date strtDate) {
		this.strtDate = strtDate;
	}

	@Column(nullable=false)
	public String getStudentEmail() {
		return studentEmail;
	}

	public void setStudentEmail(String studentEmail) {
		this.studentEmail = studentEmail;
	}

	@Basic
	public boolean isRegular() {
		return isRegular;
	}
	

	@Transient
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void setRegular(boolean isRegular) {
		this.isRegular = isRegular;
	}

	@Id
	@TableGenerator(name="AnyNameStudentIDGeneraor", table="stdID", pkColumnName="stdKey", 
	pkColumnValue="stdvalue", allocationSize=1)
	@GeneratedValue(strategy=GenerationType.TABLE, generator="AnyNameStudentIDGeneraor")
	@Column(name="StudentID")
	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	

}
